# Makefile for hbf2gf -- wl@gnu.org
# Heavy modifications for TeX Live / teTeX by Thomas Esser, te@tug.org.

kpse_include ../make/paths.mk
kpse_include ../make/common.mk
kpse_include ../make/programs.mk
kpse_include ../make/texi.mk

prog_cflags = @no_strdup@ -Dunix -DHAVE_LIBKPATHSEA

CTANGLE = ../../web2c/ctangle
CWEAVE  = ../../web2c/cweave
TEX     = tex

.SUFFIXES: .dvi .tex .w
objects = hbf2gf.o hbf.o

program = hbf2gf
programs = $(program)

default all: $(programs)

hbf2gf.c: hbf2gf.w $(CTANGLE)
	$(CTANGLE) $(srcdir)/hbf2gf.w

hbf2gf.tex: hbf2gf.w $(CWEAVE)
	$(CWEAVE) +ai $(srcdir)/hbf2gf.w

hbf2gf.dvi: hbf2gf.tex
	$(TEX) hbf2gf.tex

documentation: hbf2gf.dvi

$(program): $(objects)
	$(kpathsea_link) $(objects) $(LOADLIBES)

$(CTANGLE):
	cd ../../web2c; $(MAKE) ctangle

$(CWEAVE):
	cd ../../web2c; $(MAKE) cweave

install: install-exec install-data
uninstall: uninstall-exec uninstall-data
install-exec: all
	$(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
	for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done
uninstall-exec:
	for p in $(programs); do $(RM) $(bindir)/$$p; done

install-data:
	$(SHELL) $(top_srcdir)/../mkinstalldirs $(man1dir)
	$(INSTALL_DATA) $(srcdir)/$(program).1 $(man1dir)/$(program).$(manext)
uninstall-data:
	$(RM) $(man1dir)/$(program).$(manext)

kpse_include ../make/dist.mk
kpse_include ../make/clean.mk

distclean::
	$(RM) hbf2gf.c c-auto.h Makefile

kpse_include ../make/rdepend.mk
kpse_include depend.mk

kpathsea_parent = ../..
